import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/MusicHome',
      name: 'MusicHome',
      component: () => import('../views/MusicHome.vue'),
      children: [
        { path: '', redirect: '/HomeMusic' },
        {
          path: '/HomeMusic',
          name: 'HomeMusic',
          component: () => import('../views/homeview/HomeMusic.vue'),
        },
        {
          path: '/AiCreate',
          name: 'AiCreate',
          component: () => import('../views/homeview/AiCreate.vue'),
        },
        {
          path: '/AiMusic',
          name: 'AiMusic',
          component: () => import('../views/homeview/AiMusic.vue'),
        },
        // 添加HomeMusic路由
        {
          path: '/HomeMusic',
          name: 'HomeMusic',
          component: () => import('../views/homeview/HomeMusic.vue'),
        },
        {
          path: '/TopUp',
          name: 'TopUp',
          component: () => import('../views/homeview/TopUp.vue'),
        },
        {
          path: '/Order',
          name: 'Order',
          component: () => import('../views/homeview/Order.vue'),
        },
      ]
    },
  ],
})

export default router